<?php
if(!defined('INTHEME')){header('Location: ../../index.php'); die();}
if($foot)
{
    ?></div><?php
$skinurl = 'theme/default';


if(getConfig('debug', 'sql', '0') && $user->logged() && $user->hasAccess('admin'))
{
    $tp = explode(" ", microtime());
    $endtime = $tp[1] . substr($tp[0], 1);
    $totaltime = round(bcsub($endtime,$starttime,6),4);
    $avgqt=round($sql->totalsqltime/$sql->querycount,4);
    $tsqlt=round($sql->totalsqltime,4);
    $qc=round($sql->querycount,4);
    $time_string=sprintf($Lang['page_generated'],$totaltime, $tsqlt, $qc, $avgqt);   
    ?>
<div id="debug-bar" style="display: <?php echo $user->getVar('debug_menu')?'block':'none';?>;">
    <div id="debug-bar-bar-container" onclick="toogle_Debug()">
      <div id="debug-bar-bar">
       <span class="debug-bar-group"><font color="#008000"><b><?php echo $time_string;?></b></font></span>



<span style="float:right;"><span class="debug-bar-group"><button class="yt_button" type="button" title="<?php echo $Lang['show_debug'];?>" onclick="return false;"><img id="img_debug_toogle" alt="" src="img/up.png" width="16" height="16" /></button><button class="yt_button" type="button" title="<?php echo $Lang['close_debug'];?>" onclick="toogleDebugBar();"><?php echo $Lang['x'];?></button></span></span>
</div>
    </div>

<div id="debug-bar-content" style="display: none;">
<?php
$sql->debug();
?>
</div></div>     
<div style="display: <?php echo !$user->getVar('debug_menu')? 'block':'none';?>; position: fixed; right: 10px; bottom: 10px;" id="show_debug_bar"><button class="yt_button" type="button" title="Open Debug" onclick="toogleDebugBar();"><?php echo $Lang['enable_debug_bar'];?></button></div><?php
}
if(getConfig('debug','user',0))
{
    $user->debug();
}
}
?>
</body></html>